package com.ruoyi.driver.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.driver.mapper.DriverInfoMapper;
import com.ruoyi.driver.domain.DriverInfo;
import com.ruoyi.driver.service.IDriverInfoService;

/**
 * 驾驶员信息Service业务层处理
 * 
 * @author ssh
 * @date 2024-12-19
 */
@Service
public class DriverInfoServiceImpl implements IDriverInfoService 
{
    @Autowired
    private DriverInfoMapper driverInfoMapper;

    /**
     * 查询驾驶员信息
     * 
     * @param id 驾驶员信息主键
     * @return 驾驶员信息
     */
    @Override
    public DriverInfo selectDriverInfoById(String id)
    {
        return driverInfoMapper.selectDriverInfoById(id);
    }

    /**
     * 查询驾驶员信息列表
     * 
     * @param driverInfo 驾驶员信息
     * @return 驾驶员信息
     */
    @Override
    public List<DriverInfo> selectDriverInfoList(DriverInfo driverInfo)
    {
        return driverInfoMapper.selectDriverInfoList(driverInfo);
    }

    /**
     * 新增驾驶员信息
     * 
     * @param driverInfo 驾驶员信息
     * @return 结果
     */
    @Override
    public int insertDriverInfo(DriverInfo driverInfo)
    {
        driverInfo.setCreateTime(DateUtils.getNowDate());
        return driverInfoMapper.insertDriverInfo(driverInfo);
    }

    /**
     * 修改驾驶员信息
     * 
     * @param driverInfo 驾驶员信息
     * @return 结果
     */
    @Override
    public int updateDriverInfo(DriverInfo driverInfo)
    {
        driverInfo.setUpdateTime(DateUtils.getNowDate());
        return driverInfoMapper.updateDriverInfo(driverInfo);
    }

    /**
     * 批量删除驾驶员信息
     * 
     * @param ids 需要删除的驾驶员信息主键
     * @return 结果
     */
    @Override
    public int deleteDriverInfoByIds(String[] ids)
    {
        return driverInfoMapper.deleteDriverInfoByIds(ids);
    }

    /**
     * 删除驾驶员信息信息
     * 
     * @param id 驾驶员信息主键
     * @return 结果
     */
    @Override
    public int deleteDriverInfoById(String id)
    {
        return driverInfoMapper.deleteDriverInfoById(id);
    }
}
